﻿using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
namespace LHWebApp
{
    /// <summary>
    /// CommonService 的摘要说明 
    /// </summary>
    [WebService(Namespace = "http://www.unisailing.com/", Description = "[作者]:Liys <br>[描述]:通用WebService<br>[版本]:v1.0<br>[创建日期]:20120329")]
    //[WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    //[WebServiceBinding(ConformsTo = WsiProfiles.None)]
    [ToolboxItem(false)]
    public class CommonService : System.Web.Services.WebService
    {

        public CommonService()
        {

            //如果使用设计的组件，请取消注释以下行 
            //InitializeComponent(); 
        }

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        [WebMethod]
        public DataSet GetData(string sql, string resultName)
        {
            return Services.GetData(sql, resultName);
        }
        [WebMethod(Description = "[作者]:Liys <br>[描述]:下发消息<br>[版本]:v1.0<br>[创建日期]:20110315")]
        public string SendMessage(string cardNo, string msg)
        {
            return Services.SendMessage(cardNo, msg);
        }
        [WebMethod]
        public int SetData(string sql)
        {
            return Services.SetData(sql);
        }
        public DataSet GetArticles(int start, int limit, string sort, string dir)
        {
            return Services.GetArticles(start, limit, sort, dir);
        }
        //[WebMethod]
        //public DataSet GetVehicleCurrentInfoList(string clientNo)
        //{
        //    return Services.GetVehicleCurrentInfoList(clientNo);
        //}
        [WebMethod]
        public DataSet GetVehicleHistoryInfoList(string startDate, string endDate, int vid)
        {
            return Services.GetVehicleHistoryInfoList(startDate, endDate, vid);
        }



        [WebMethod]
        /// <summary>
        /// 查找报警信息
        /// </summary>
        /// <param name="start"></param>
        /// <param name="limit"></param>
        /// <param name="sort"></param>
        /// <param name="dir"></param>
        /// <param name="StartTime"></param>
        /// <param name="EndTime"></param>
        /// <param name="AlarmType"></param>
        /// <param name="Flag"></param>
        /// <param name="LicensePlate"></param>
        /// <returns></returns>
        public DataSet GetAlarms(int start, int limit, string sort, string dir, string StartTime, string EndTime, int AlarmType, int Flag, string LicensePlate)
        {
            return ServicesVehicleAlarmInfo.GetAlarms(start, limit, sort, dir, StartTime, EndTime, AlarmType, Flag, LicensePlate);
        }

        [WebMethod]
        public DataSet GetAlarmList(string clientNo, string currentService)
        {
            return ServicesVehicleAlarmInfo.GetAlarmList(clientNo, currentService);
            //return Services.GetAlarmList(clientNo);
        }
        [WebMethod]
        public bool AlarmInfoDelBatch(string alarmIDList)
        {
            return ServicesVehicleAlarmInfo.AlarmInfoDelBatch(alarmIDList);
        }
        [WebMethod]
        public bool AlarmInfoConfirmBatch(string alarmIDList, string op, string disposition)
        {
            return ServicesVehicleAlarmInfo.AlarmInfoConfirmBatch(alarmIDList, op, disposition);
        }
        [WebMethod]
        public DataSet GetClientInfoList(string service, string rootID)// 获取组织机构
        {
            return Services.GetClientInfoList(service, rootID);
        }

        [WebMethod]
        public DataSet GetVehicleInfoList(string rootID)
        {
            return Services.GetVehicleInfoList(rootID);
        }
    }
}

